package service

import (
	"go-0650-blog-grom/dao/mysql"
	"go-0650-blog-grom/models"
)

type CommunityService struct {
}

/**
 * @Author SSWANG
 * @Description //TODO 查询分类社区列表
 * @Date 20:53 2022/10/28
 **/
func (con CommunityService) GetCommunityList() ([]*models.Community, error) {
	// 查数据库 查找到所有的community 并返回
	return mysql.CommunityMapper{}.GetCommunityList()
}

/**
 * @Author SSWANG
 * @Description //TODO 根据ID查询分类社区详情
 * @Date 21:01 2022/10/28
 **/
func (con CommunityService) GetCommunityDetailByID(id uint64) (*models.CommunityDetail, error) {
	return mysql.CommunityMapper{}.GetCommunityByID(id)
}
